{// 引入标签库 }
<tagLib name="html" />
<php>
    function get_level($level){
        $user_level = $GLOBALS['db']->getOne("select `name` from ".DB_PREFIX."user_level where level = '".intval($level)."'");
        return $user_level;
    }
    function head_image($head_image){
        return "<img src='".$head_image."' style='height:35px;width:35px;'/>";
    }
    function get_ban($is_ban){
        if($is_ban==1){
            return '是';
        }else{
            return '否';
        }
    }
</php>
<include file="Public:header" />
<script type="text/javascript" src="__ROOT__/public/region.js"></script>
<script type="text/javascript" src="__TMPL__Common/js/calendar/calendar.php?lang=zh-cn" ></script>
<load href='__TMPL__Common/js/calendar/calendar.css' />
<load href='__TMPL__Common/js/calendar/calendar.js' />
<load href='__TMPL__Common/js/user_edit.js' />
    <script>
        function set_follower(id){
            if(!id)
            {
                idBox = $(".key:checked");
                if(idBox.length == 0)
                {
                    alert("请选择需要新增的用户");
                    return;
                }
                idArray = new Array();
                $.each( idBox, function(i, n){
                    idArray.push($(n).val());
                });
                id = idArray.join(",");
            }
            var user_id = $("#user_id").val();
            if(confirm("确定要新增选中的用户吗？"))
                $.ajax({
                    url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=set_follower&id="+id+"&user_id="+user_id,
                    data: "ajax=1",
                    dataType: "json",
                    success: function(obj){
                        if(obj.status==1)
                            location.href = ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=fans_list&id="+user_id;
                        else
                            alert(obj.info);
                    }
                });
        }
    </script>
<div class="main">
<div class="main_title">{$user.nick_name} 新增粉丝 <a href="{:u($module_name."/fans_list",array("id"=>$user['id']))}" class="back_list">{%BACK_LIST}</a></div>
    <div class="search_row">
        <form name="search" action="__APP__" method="get" class="clearfix">
            <input type="hidden" name="user_id" id="user_id" value="{$user.id}"/>
            <!--主播ID：<input type="text" class="textbox" name="id" value="{:trim($_REQUEST['id'])}" style="width:100px;" />-->
            <div>主播昵称：<input type="text" class="textbox" name="nick_name" value="{:trim($_REQUEST['nick_name'])}" style="width:100px;" /></div>
            <div>注册时间：<span><input type="text" class="textbox" name="create_time_1" id="create_time_1" value="{$_REQUEST['create_time_1']}" onfocus="this.blur(); return showCalendar('create_time_1', '%Y-%m-%d', false, false, 'btn_create_time_1');" /><input type="button" class="button" id="btn_create_time_1" value="{%SELECT_TIME}" onclick="return showCalendar('create_time_1', '%Y-%m-%d', false, false, 'btn_create_time_1');" /></span> - <span><input type="text" class="textbox" name="create_time_2" id="create_time_2" value="{$_REQUEST['create_time_2']}" onfocus="this.blur(); return showCalendar('create_time_2', '%Y-%m-%d', false, false, 'btn_create_time_2');" /><input type="button" class="button" id="btn_create_time_2" value="{%SELECT_TIME}" onclick="return showCalendar('create_time_2', '%Y-%m-%d', false, false, 'btn_create_time_2');" /></span>
            <input type="hidden" value="{$module_name}" name="m" /><input type="hidden" value="add_fans" name="a" /><input type="submit" class="button" value="{%SEARCH}" /></div>
        </form>
    </div>
    <html:list
            id="dataTable"
            style="dataTable"
            name="user"
            checkbox="true"
            action="true"
            datasource="list"
            show="id:{%ID}
			,nick_name:{%NICK_NAME}
			,head_image|head_image:{%USER_HEADIMAGE}
			,diamonds:{%DIAMONDS}
			,use_diamonds:{%USER_DIAMONDS}
			,ticket:{%USER_TICKET}
			,score:{%USER_SCORE}
			,focus_count:{%USER_FOCUS}
			,fans_count:{%USER_FANS}
			,user_level|get_level=$user['user_level']:{%LEVEL}
			,is_ban|get_ban=$user['id']:{%IS_BAN}"
            actionlist="set_follower:{%ADD}" />
    <!--  del:{%DEL}, -->
    <table class="dataTable">
        <tbody>
        <td colspan="14">
            <input type="button" class="button button-add" value="{%ADD}" onclick="set_follower();" />
        </td>
        </tbody>
    </table>
    <div class="page">{$page}</div>
</div>
<include file="Public:footer" />